﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using XCore.Domain.Entities;
using XCore.Logger;

namespace SaaS.Model.Entity.Logs
{
    [Table("ClientLog")]
    public class ClientLog : Entity<long>, IHasCreationTime, IHasCreateionIpAddress
    {
        public int? TenantId { get; set; }
        /// <summary>
        /// 来源
        /// </summary>
        public int Source { get; set; }
        /// <summary>
        /// 日志等级
        /// </summary>
        [StringLength(64)]
        public string Level { get; set; }
        /// <summary>
        /// 消息
        /// </summary>
        [StringLength(1024)]
        public string Message { get; set; }
        /// <summary>
        /// 执行时长(毫秒)
        /// </summary>
        public int ExecutionDuration { get; set; }
        /// <summary>
        /// 客户端IP地址
        /// </summary>
        [StringLength(64)]
        public string IP { get; set; }
        /// <summary>
        /// 系统类型
        /// </summary>
        [StringLength(32)]
        public string SystemType { get; set; }
        /// <summary>
        /// 浏览器信息
        /// </summary>
        [StringLength(256)]
        public string BrowserInfo { get; set; }
        /// <summary>
        /// 堆栈信息
        /// </summary>
        public string StackTrace { get; set; }
        /// <summary>
        /// 异常
        /// </summary>
        public string Exception { get; set; }
        /// <summary>
        /// 数据 Json格式
        /// </summary>
        public string CustomData { get; set; }
        /// <summary>
        /// 执行时间
        /// </summary>
        public DateTime CreationTime { get; set; }
    }
}
